package com.simtop.dao;

import com.simtop.pojo.userpo.User;
import com.simtop.pojo.userpo.Userse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserDao {
    int insertBackUser2(Userse users);

    int checkLoginName(String loginName);

    int checkEmail(String email);

    int insert(User user);

    User checkLoginNameOrEmail(@Param("loginName") String loginName, @Param("email") String email);

    int updatePasswordByEmail(User user);

    List<User> selectAll(User user);

    int insertBackUser(User user);

    int deleteByUserId(Integer id);

    int updateBackendUser(User user);

    List<User> selectByParams(User user);

    int selectUserCounts();

    User findById(Integer id);

    User findByLoginName(String loginName);

    int inserIlabUser(User user);

    /**
     * 统计各个省份对应的人数
     *
     * @return
     */
    public List<Map<String, Integer>> getProvinceCount();

    /**
     * 统计各个角色对应的人数
     *
     * @return
     */
    public List<Map<String, Integer>> getRoleCount();

    /**
     * 修改用户名
     *
     * @param loginName
     * @param userName
     * @return
     */
    boolean updateUserName(@Param("loginName") String loginName, @Param("userName") String userName);
}
